#pragma once

#include "../Core/Singleton.h"
#include "../Core/Socket.h"
#include "../Core/Timer.h"

#ifdef WIN32
#define HOSTNAME "dovasi2"
#else
#define HOSTNAME "dovasi1"
#endif
#define DOMAINNAME "polonia.aero"

enum ApplicationStates
{
	ApplicationState_OnlineUnary = 0,
	ApplicationState_OnlinePrimary,
	ApplicationState_OnlineStandby,
	ApplicationState_Offline,
};

enum ApplicationMessageLevels
{
    ApplicationMessageLevel_Info = 0,
    ApplicationMessageLevel_Warning,
    ApplicationMessageLevel_Critical,
};

class Application : public Singleton<Application>, public Timer
{
	friend class Singleton<Application>;

protected:
	Socket m_Socket;
	InternetAddress m_BroadcastAddress;
	Application();

public:
	char ApplicationId;
	ApplicationStates State;
	std::string ApplicationName;

	void BroadcastHeartBeat();
	void ExecuteByInterval();
	void SendMessageToAttnWindow(InternetAddress pDestination , ApplicationMessageLevels pLevel , std::string pMessage);
};
